<template>
	<view style="padding: 50rpx;">
		<view style="text-align: center;">
			<image style="height: 120rpx;" src="https://ksdaojiajia.com/mp-weixin/static/img/logo.png" mode="aspectFit">
		</view>
		<view class="title1">
			师傅协议须知
		</view>
		<view class="context">
			<parse :content="xycontent" @navigate="navigate"></parse>
		</view>
		<view style="margin-top: 20rpx;">
			<view @tap.stop='isagreeChange'>
				<checkbox-group style="display: inline-block;">
					<checkbox style="transform: scale(0.6)" value="1" :checked="isagree" />
					<text>我已阅读并且同意</text>
				</checkbox-group>
				<text style="color: red;">
					<{{xyname}}>
				</text>
			</view>
			<button class="btn1" @tap.stop="next" style="background-color: #FF6F30; color: #fff;">下一步（实名认证）</button>
		</view>
	</view>
</template>

<script>
	var app = getApp();

	export default {
		data() {
			return {
				opt: {},
				xyname: '黔易修师傅协议',
				xycontent: '.........这是协议内容........xxx.....xxxxxxx.123.这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容这是协议内容',
				isagree: false
			};
		},

		onLoad: function(opt) {
			wx.getStorage({
			  key: 'worker_login',
			  success: function (res) {
				  if(res.data.worker_admin && app.globalData.is_worker == 0){
					  app.globalData.is_worker++;
					  //师傅已登录跳转到抢单大厅
					  // app.goto('/activity/yuyue/dating', 'reLaunch');
				  }
			  },
			  fail: function (res) {
			  },
			});
			this.opt = app.getopts(opt);
			this.gatdata();
		},
		onShow: function() {
			
		},
		onPullDownRefresh: function() {
		},
		methods: {
			gatdata: function(){
				
			},
			next: function(e) {
				//下一步
				if (this.isagree)
					app.goto('authentication');
				else
					app.error('请勾选并阅读师傅注册协议');
			},
			isagreeChange: function(e) {
				//勾选协议函数
				if (!this.isagree) {
					this.isagree = true;
				} else {
					this.isagree = false;
				}
			},
		}
	};
</script>

<style>
	page {
		background: #ffffff;
		width: 100%;
		height: 100%;
	}

	.title1 {
		text-align: center;
		opacity: 1;
		font-size: 40rpx;
		font-weight: bold;
		line-height: 90rpx;
	}



	.btn1 {
		width: 100%;
		height: 88rpx;
		border-radius: 88rpx;
		line-height: 88rpx;
		margin: 20rpx 0;
		text-align: center;
		font-weight: bold;
	}


</style>